(ns cljfx.dsl-test
  (:import [javafx.scene.control Label Button])
  (:require [cljfx.dsl :refer :all]
            [clojure.test :refer :all]))

(deftest -test-builders-and-attrs
  (testing "defattr"
    (testing "text"
      (let [lbl (label (text "test label text"))
            btn (button (text "test button text"))]
        (is (= (class lbl) Label))
        (is (= (class btn) Button))
        (is (= (.getText lbl) "test label text"))
        (is (= (.getText btn) "test button text"))))
    (testing "maxSize"
      (let [lbl (label (maxSize 10 100))]
        (is (= (.getMaxHeight lbl) 100.))
        (is (= (.getMaxWidth lbl) 10.))
        )
      )
    ))

(run-tests)

